/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 技术负责人相关接口模块
 * +----------------------------------------------------------------------
 */
layui.define(['jquery', 'configure', 'configureCom', 'bluebird'], function (exports) {
    var configure = layui.configure;
    var configureCom = layui.configureCom;
    var technologyLeader = {
        param: {
            resultId: -1,
            resultType: 0,
            data: {
                sgProjApplyItemId:'',//受理字表id
                checkResult:'',//审查结果1010,1020,1030
                sgProjLeaderId: '',//技术负责人分配id
                specIdORLeaderResults: ''//专业id1_1010,专业id2_1020
            }
        },
        leaderCheckAddResult: function () {
            //技术负责人添加结论接口
            return new Promise(function (resolve, reject) {
                configureCom.postDataAjax(configure.TECHNOLOGY_LEADER_CHECK_Add_RESULT_HTTP, technologyLeader.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        leaderSignAddResult: function () {
            //技术负责人确认签发接口
            return new Promise(function (resolve, reject) {
                configureCom.postDataAjax(configure.TECHNOLOGY_LEADER_CONFIRM_Add_RESULT_HTTP, technologyLeader.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        getLeaderResultList: function () {
            //获取技术负责人结论列表
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.TECHNOLOGY_LEADER_CHECK_ITEMS_HTTP.replace('{sgProjLeaderId}', technologyLeader.param.data.sgProjLeaderId), technologyLeader.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        getLeaderConfirmList: function () {
            //获取技术负责人查看确认签发结论列表
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.TECHNOLOGY_LEADER_CONFIRM_ITEMS_HTTP.replace('{sgProjApplyItemId}', technologyLeader.param.data.sgProjApplyItemId), technologyLeader.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        }
    };
    exports('technologyLeader', technologyLeader);
});